#ifndef OMG_DDS_RPC_H
#define OMG_DDS_RPC_H

#include <string>
#include "dds.h"

namespace dds {

namespace rpc {

using namespace dds::domain;
using namespace dds::sub;
using namespace dds::pub;
using namespace dds;

class ServantBase {
public:
  dds::domain::DomainParticipant get_domain_participant() const;
  std::string get_service_name() const;
  std::string get_instance_name() const;
  dds::sub::DataReaderQos get_request_datareader_qos() const;
  dds::pub::DataWriterQos get_reply_datawriter_qos() const;
};

template <class T>
class ServiceImpl; // only a declaration

class ServiceProxyBase
{
protected:
  ServiceProxyBase();
  ServiceProxyBase(const ServiceProxyBase &);

public:
  bool is_bound() const;
  bool get_service_info(std::string & service_name,
    std::string & bound_instance) const;

  std::string get_service_name() const;
  void bind(const std::string & instance_name);
};

template <class T>
class ServiceProxy; // only a declaration 

class RPCRuntime
{
public:
  RPCRuntime(dds::domain::DomainParticipant * dp) {}

  template <class T>
  void create_service(
    ServiceImpl<T> & service_impl,
    const std::string & service_name,
    const std::string & instance_name,
    const DataReaderQos & drqos = DataReaderQos(),
    const DataWriterQos & dwqos = DataWriterQos()) {}

  template <class T>
  ServiceProxy<T> create_client(
    const std::string & service_name,
    const std::string & instance_name,
    const DataReaderQos & drqos = DataReaderQos(),
    const DataWriterQos & dwqos = DataWriterQos()) 
  {
    return ServiceProxy<T>();
  }

  void start_service_processing(bool process_events_in_main = false) {}
};

} // namespace rpc
} // namespace dds


#endif // OMG_DDS_RPC_H
